﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Experiment.BLL;

namespace Experiment.Account
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<User> allUsers = Controller.CreateUsers();
            Application["allUsers"] = allUsers;

            
        }

        protected void LoginButton_Click(object sender, EventArgs e)
        {
             Dictionary<string, int[]> answers = new Dictionary<string, int[]>(); //key = doc name. value = the answers  of the question
             Session["answers"] = answers;
             List<User> allUsers = (List<User>)Session["allUsers"];
            //to do the selection algor
            //
            //
            //
             User user = allUsers[0];
             List<Document> allDoc = Controller.displayDocs(user);
             Session["DocumentList"] = allDoc;
             Session["CurrentDoc"] = 0;
             Session["Username"] = ((TextBox)LoginUser.FindControl("UserName")).Text;
             Response.Redirect("DisplayText.aspx");
        }
    }
}
